|
This page last changed on Mar 25, 2009 by tm.
AUV Debian 4.0 Linux Install and Setup, auv packages install and build
Links
To Do List
- config out the audio support (kahlua)
- startup
- startup omniNames & and notifd -c $OMNINOTIFY_DIR/channel.cfg &
- Investigate update to newer kernel (2.6.24 recommended since it's slated for next debian release 'lenny'). This is to fix the timing issue found in tailcone test (off by 4msec).
- 25 July 2008 - looks like there is a memory leak in the ashtec driver (based on the overnight test).
- download duma_2_5_14, untar and run 'make install'
- Modify linker command file to add -lduma
-
Issues
Native development: auv-linux software is not compatible with version 3.1 of debian due to gcc/glibc issues.
- Resolution: install latest stable debian release (4.0 etch) as this is closer in compatibility to Fedora Core 6 currently in use by the development team
- Recommendation: install the same linux on workstations as on embedded PC104 (test what you fly, fly what you test). The problem with installing Fedora Core 6 is that it is no longer available for download (7 and 8 are available) and is not currently supported by Red Hat. Fedora is the experimental branch that feeds the product Red Hat Enteprise releases and may not have the level of sustained support to be used long term in the AUV.
- Experiemented with Fedora Core 8 installation. auv-linux build failed with a seg fault in doxygen - this likely could be patched, but didn't want to spend the time.
- Which Distro?
- Debian Pro's
- Widely used in embedded systems (as well as servers and back-end equipment with strong uptime requirements)
- Robust, supported, production release avaible
- Retargettable to other embedded instruction set architectures (ARM, PowerPC, etc.)
- Debian and it's derivatives are made by and used by hardcore linux developers / experts
- Debian Con's
- RedHat and Fedora have a broader user familiarity at MBARI than Debian - 'Debian is different'
- Debian is not installed on development workstations - time impact to install. (A mitigation option could be to make a VMWare or Xen image of Debian).
- Fedora Core 6 Pro's
- Used by auv-linux developers on their workstations
- Used by T-Rex team on workstations and embedded PC104 processor
- Familiar to MBARI development engineers
- Fedora Core 6 Con's
- Fedora is Red Hat's experimental code stream not intended for production use. Lacks long term support.
- Fedora Core 6 is NO LONGER AVAILABLE for download
- Fedora Core 6 is ad hoc updated by developers. An informal poll shows one machine at 2.6.22, and another at 2.6.20. Stock FC6 is 2.6.18 (same as Debian 4.0).
- Recommend selecting an up to date production distro that can have a service life of 2 to 3 years.
Xtreme104 Serial Setup
serial.conf looks like
mvc-debian4:/proc# cat /etc/serial.conf
/dev/ttyS1 uart 16450 port 0x2F8 irq 3
#Xtreme card
# Group A
/dev/ttyS2 uart 16850 port 0x380 irq 9 baud_base 1500000
/dev/ttyS3 uart 16850 port 0x388 irq 9 baud_base 1500000
/dev/ttyS4 uart 16850 port 0x390 irq 9 baud_base 1500000
/dev/ttyS5 uart 16850 port 0x398 irq 9 baud_base 1500000
# Group B
/dev/ttyS6 uart 16850 port 0x300 irq 9 baud_base 1500000
/dev/ttyS7 uart 16850 port 0x308 irq 9 baud_base 1500000
/dev/ttyS8 uart 16850 port 0x310 irq 9 baud_base 1500000
/dev/ttyS9 uart 16850 port 0x318 irq 9 baud_base 1500000
# Group C
/dev/ttyS10 uart 16850 port 0x150 irq 9 baud_base 1500000
/dev/ttyS11 uart 16850 port 0x158 irq 9 baud_base 1500000
/dev/ttyS12 uart 16850 port 0x160 irq 9 baud_base 1500000
/dev/ttyS13 uart 16850 port 0x168 irq 9 baud_base 1500000
mvc-debian4:/proc# cat /proc/interrupts
CPU0
0: 45634199 XT-PIC timer
1: 8 XT-PIC i8042
2: 0 XT-PIC cascade
6: 3 XT-PIC floppy
7: 0 XT-PIC parport0
8: 1 XT-PIC rtc
9: 67591801 XT-PIC serial
11: 865812 XT-PIC eth0
14: 153327 XT-PIC ide0
NMI: 0
LOC: 0
ERR: 0
MIS: 0
mvc-debian4:/proc# setserial -g /dev/ttyS5
/dev/ttyS5, UART: 16850, Port: 0x0398, IRQ: 2
mvc-debian4:/proc# setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16450, Port: 0x02f8, IRQ: 3
/dev/ttyS10, UART: 16850, Port: 0x0150, IRQ: 2
/dev/ttyS11, UART: 16850, Port: 0x0158, IRQ: 2
/dev/ttyS2, UART: 16850, Port: 0x0380, IRQ: 2
/dev/ttyS3, UART: 16850, Port: 0x0388, IRQ: 2
/dev/ttyS4, UART: 16850, Port: 0x0390, IRQ: 2
/dev/ttyS5, UART: 16850, Port: 0x0398, IRQ: 2
/dev/ttyS6, UART: 16850, Port: 0x0300, IRQ: 2
/dev/ttyS7, UART: 16850, Port: 0x0308, IRQ: 2
/dev/ttyS8, UART: 16850, Port: 0x0310, IRQ: 2
/dev/ttyS9, UART: 16850, Port: 0x0318, IRQ: 2
mvc-debian4:/proc# cat ioports
0000-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-006f : keyboard
0070-0077 : rtc
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0150-0157 : serial
0158-015f : serial
01f0-01f7 : ide0
02f8-02ff : serial
0300-0307 : serial
0308-030f : serial
0310-0317 : serial
0318-031f : serial
0378-037a : parport0
037b-037f : parport0
0380-0387 : serial
0388-038f : serial
0390-0397 : serial
0398-039f : serial
03c0-03df : vga+
03f2-03f5 : floppy
03f6-03f6 : ide0
03f7-03f7 : floppy DIR
03f8-03ff : serial
0cf8-0cff : PCI conf1
e000-e03f : 0000:00:11.0
e000-e03f : e100
f000-f00f : 0000:00:12.2
f000-f007 : ide0
f008-f00f : ide1
Useful Debian links
Native Development Environment: Debian 4.0 Install and auv-linux software install
- Install Debian 4.0 (etch):
- Warning: 5GB harddisk will run out of space if config'd during debian install for separate /home partition when building linux kernel to config the serial port.
- Burn DVD with net install and boot PC from DVD
- Hostname: mvc-debian4
- Domain: shore.mbari.org
- Partitioning: Guided - use entire disk. Either "all files in one partion' (or 'separate /home partition). This creates ext3 file system in the partitions.
- users: auv (for development) and dorado1 (for runtime)
- Use network mirror for complete package list (if internet connected)
- Software install: Standard (only)
- Install Grub to the master boot record
- Remove DVD and allow boot from harddisk
- Time: (~45 min depending on harddisk format time)
- After boot, login as root and re-insert Debian 4 r3 net install DVD.
- Run aptitude (as root), browse to 'Not Installed Packages' and select: (15 min)
- ant - XML build system
- ant-optional
- autoconf
- autogen
- automake (should already be selected)
- binutils - GNU assembler, linker and binary utils
- bison - (fixes error in auv-shared build where lex not found)
- cccc - c and c++ code counter, software metrics tool (optional)
- curves - cvs console app (optional)
- cvs
- doxygen
- electric-fence - malloc debugger
- flex - lexical analyzer generator for auv builds (fixes error in auv-shared build where lex not found)
- g++ (4.1 pulls in gcc 4.1)
- libtool (fixes error in log4cxx build 'libtoolize not found')
- linux-source-2.6.18
- make
- (omniidl and omniorb are tempting - talk to Tom)
- oprofile - performance profiling tool
- subversion (for pulling log4cxx from apache)
- editors (elvis-console for vi with multiple files, qemacs, vim)
- linux-source (under virtual packages, needed for rebuilding kernel to config the serial drivers)
- Install the following with apt-get (could also install these packages with aptitude): (10 min)
- *apt-get install subversion
- *apt-get install libtool
- apt-get install gdb
- apt-get install openssl
- apt-get install ssh (secure shell server)
- apt-get install minicom
- apt-get install python-all
- apt-get install python-all-dev (needed for omniORB build)
- apt-get install lirc setserial
- *apt-get install linux-source-2.6.18
- apt-get install kernel-package libncurses5-dev fakeroot wget build-essential (kernel build and debian package create)
- apt-get install xutils-dev (auv-shared needs gccmakedep utility)
- apt-get install linux-doc-2.6.18 (optional for docs)
- apt-get install linux-manual-2.6.18 (optional for docs)
- apt-get install manpages-dev (man pages for kernel api's such as termios, etc.)
- (not needed) apt-get install khexedit (for debug of parosci serial port problems)
- Setup the auv-linux development environment (build and install auv-pkgs (1.5hrs), auv-shared and auv-linux)
- as 'auv', mkdir /home/auv/prj. cd /home/auv/prj
- export CVSROOT=':pserver:tm@moonjelly.shore.mbari.org:/home/cvs'
- cvs login
- cvs checkout auv-pkgs
- cvs checkout auv-shared
- cvs checkout auv-linux
- cd /home/auv/prj/auv-pkgs
- source set-auv-env (or ". set-auv-env")
- edit /home/auv/.bash_profile, add source /home/auv/prj/auv-pkgs/set-auv-env for persistance
- setup, build and install auv-pkgs
- su root
- cd $AUV_PKGS
- . 1_omniORB.bat
- . 2_omniNotify.bat
- . 3_gctpc.bat
- . 4_apr.bat
- . 5_apr-util.bat
- . 6_log4cxx.bat
- . 7_netcdb.bat
- . 8_newmat.bat
- . 9_cppunit.bat
- . final.bat (changes owner ship of prj directory to 'auv'
- As root, add auv startup script to /etc/init.d: /etc/init.d/auv-startup.sh
- #!/bin/sh
# auv startup script
-
- # initialize Posix mqueue infrastructure
mkdir /dev/mqueue
mount -t mqueue none /dev/mqueue
- chmod 777 /dev/mqueue
- chmod a+x auv-startup.sh
- Then (as root) update the startup sequence: update-rc.d -f auv-startup.sh start 80 2 3 4 5 .
-
- Note to remove: update-rc.d S80auv-startup.sh remove
- to disable the script - rename S80auv-startup.sh to K80auv-startup.sh. read the README in /etc/rcS.d/README
- exit back to user 'auv'
- build auv-shared
- in auv-shared/utility/Makefile - change LIBPATH to: LIBPATH = $AUV_PKGS/omniORB/build/lib/
- apt-get install xutils-dev to get gccmakedep
- build auv-linux
- edit taskIF Makefile - comment out idlj and javac lines
- Run supervisor (this creates logs/latest link)
- from auv-linux/onboard, run
- supervisor -proc sampleConfig/simprocesses.cfg -plan sampleConfig/simWaypoint.cfg
-
- Rebuilding the linux kernel to enable the serial drivers on the Xtreme PC104 serial card (start 3:45
- Note: Procedure for Xtreme 104 12 port serial card is at http://www.connecttech.com/ftp/installguides/s_install_EC-LN26.htm
- logged in as root
- cp serial.conf /etc
- cd /usr/src
- tar jxf linux-source-2.6.18.tar.bz2
- cd linux-source-2.6.18
- make clean && make mrproper
- uname -r to get /boot/config-'uname -r' name
- cp /boot/config-2.6.18-6-686 ./.config (copy the previous kernel config)
- make menuconfig
- Go to Load an Alternate Configuration File (page down) and choose .config (which contains the configuration of your current working kernel)
- Device Drivers --> Character devices
- deselect (no *) the 'Non-standard serial port support (config: CONFIG_SERIAL
menuconfig: (Character Devices -> Standard/generic (dumb) serial support)
- config: SERIAL_8250
menuconfig: (Device Drivers -> Character Devices -> Serial drivers -> 8250/16550 and compatible serial support)
- config: CONFIG_SERIAL_8250_EXTENDED
menuconfig: (Device Drivers -> Character Devices -> Serial drivers -> Extended 8250/16550 serial driver options)
- config: CONFIG_SERIAL_8250_MANY_PORTS
menuconfig: (Device Drivers -> Character Devices -> Serial drivers -> Support more than 4 legacy serial ports)
- config: CONFIG_SERIAL_8250_SHARE_IRQ
menuconfig: (Device Drivers -> Character Devices -> Serial drivers -> Support for sharing serial interrupts)
- I also enabled Number of 8250/16550 serial ports to register at runtime to be 12 (was 4), this was not in manufacturers instructions.
- make-kpkg clean
- fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers (note the space after custom (your string) and kernel_image)
- After the append to version, you can write any string (replace custom with your string). Restrictions are all lower case and must not contain whitespace or special chars (dash ok).
- dpkg -i linux-image-2.6.21.3-custom_2.6.21.3-custom-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.21.3-custom_2.6.21.3-custom-10.00.Custom_i386.deb
- Optional: Remove (comment out) the unwanted kernel from /boot/grub/menu.lst. The board will boot the newly built kernel so no action required.
- serial.conf was editted to change IRQ from 10 to 9 as there was a PC104 reconfig at some point.
- To finish workstation setup (if you want to run debian as a workstation with DHCP and seen on MBARI network do the following:
- First, see if your host name is set correclty using the following commands:
uname -n
hostname -a
hostname -s
hostname -d
hostname -f
hostname
-
- edit /etc/network/interfaces. Add the line 'hostname mvc-debian4.shore.mbari.org' under iface eth0 inet dhcp
- iface eth0 inet dhcp
hostname mybox.mydomain.com
- In /etc/dhcp3/dhclient.conf, uncomment and edit #send host-name "andare.fugue.com";
- To auto start omniNames and omniNotify services at bootup:
- create a file called 'startCorba.sh'
- #!/bin/bash
# Start CORBA (omniORB and omniNotify) services - name service and notification service.
- # . /etc/init.d/functions
export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/local/lib
export OMNIORB_HOME=/home/auv/prj/auv-pkgs/omniORB
export OMNIORB_CONFIG=$OMNIORB_HOME/omniORB.cfg
export OMNINAMES_LOGDIR=$OMNIORB_HOME/nameServiceLog
export OMNINOTIFY_DIR=/home/auv/prj/auv-pkgs/omniNotify
- # Start name service
echo "Start name service"
/usr/local/bin/omniNames &
- # Start notification service
echo "Start notification service"
/usr/local/bin/notifd -c $OMNINOTIFY_DIR/channel.cfg &
- make sure startCorba has execute permissions (chmod a+x startCorba.sh)
- Create a symbolic link using update-rc.d (Debian command)
- mvc-debian4:/etc/init.d# update-rc.d startCorba defaults
Adding system startup for /etc/init.d/startCorba ...
/etc/rc0.d/K20startCorba -> ../init.d/startCorba
/etc/rc1.d/K20startCorba -> ../init.d/startCorba
/etc/rc6.d/K20startCorba -> ../init.d/startCorba
/etc/rc2.d/S20startCorba -> ../init.d/startCorba
/etc/rc3.d/S20startCorba -> ../init.d/startCorba
/etc/rc4.d/S20startCorba -> ../init.d/startCorba
/etc/rc5.d/S20startCorba -> ../init.d/startCorba
- TODO:
- Get rid of boot up issues (kahlua audio, etc.) that are relics from installing on workstation
- Moving the harddrive from a workstation to the AUV (Lippert Coorunner (II?) AMD Geode PC104)
- Before shutdown on workstation (just prior to move), delete the ethernet address bound in the file /etc/udev/rules.d/z25_persistent-net.rules).
- If this file is not deleted, the eth0 interface will not come up and a message at boot "SIOCSIFADDR: no such device eth0" with no eth0 will result
- ifup eth0 will also show the error
- Network Settings (/etc/network/interfaces)
- change from workstation setup to auv setup (dhcp to static and mvc-debian4 to mvc-debian for AUV)
- edit /etc/hosts and change mvc-debian4 to mvc-debian
- edit /etc/dhcp3/dhclient.conf to add the following line:
- send host-name "foce2.shore.mbari.org"
- 127.0.0.1 localhost.localdomain localhost
- 134.89.32.16 mvc-debian.shore.mbari.org mvc-debian
- hostname mvc-debian.shore.mbari.org
- copy the interfaces (see attachment to this wiki) file to /etc/network
- address 134.89.32.16
- netmask 255.255.254.0
- gateway 134.89.32.1
- broadcast 134.89.32.255
- to check the hostname is set properly
- uname -n
- hostname -a
- hostname -s
- hostname -d
- hostname -f
- hostname
- For future apt-get usage - edit /etc/apt/sources.list and comment out the cdrom drive. This will get packages by ftp from debian mirror.
- Notes:
- Corba
- It might be better to pull in the omniORB4 from Debian since there are build errors and complexity associated with omniORB. The default config file location is /etc/omniORB4.cfg.
- Looks like the serial.conf file borrowed from debian 3.1 is not setting up the serial ports correctly - not sure if this was ever tested (likely not). Resolution: Need to rebuild the linux kernel to enable standard serial, etc. Instructions added above
- Tar up the built prj directory for transfer to another hard disk:
- tar -pczf auv-prj-built.tar.gz prj
Notes from ConnectTech Support site for Xtreme104 Isolated 12 port serial card
Configuring the Kernel(2.6.x)The 2.6 kernel has support for the 8250/16650 UART in <src>/drivers/serial/8250.c. You should be able to run our ISA serial cards(Echo, DFlex, Xtreme/104) with this driver and the proper Kernel configuration.You'll need to edit your serial.h file in <src>/include/asm and add in the extra serial ports of the card.Here's what I added in red for a 4 port Xtreme/104 card at I/O 300 and IRQ 5. You can do the same with your card settings. If your card is using a higher clock than be sure to adjust your BAUD_BAUD value accordingly
Base baud for CTI boards. Default Max Baud = 115200 bps
define CTI_BAUD (1843200 /16)define STD_SERIAL_PORT_DFNS
UARTCLKPORTIRQ FLAGS */ {color}
Unknown macro: { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }
ttyS0
Unknown macro: { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }
ttyS1
Unknown macro: { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }
ttyS2
Unknown macro: { 0, BASE_BAUD, 0x2E8, 3, STD_COM_FLAGS }
ttyS3
Unknown macro: { 0, CTI_BAUD, 0x300, 5, STD_COM_FLAGS }
ttyS4
Unknown macro: { 0, CTI_BAUD, 0x308, 5, STD_COM_FLAGS }
ttyS5
Unknown macro: { 0, CTI_BAUD, 0x310, 5, STD_COM_FLAGS }
ttyS6
Unknown macro: { 0, CTI_BAUD, 0x318, 5, STD_COM_FLAGS }
ttyS7
If your board has a difference clock, be sure to change the CTI_BAUD value appropriately.
Re-Compiling the Kernel(Linux 2.6)
*# cd
Unknown macro: {Linux} *
At this point, you have a choice of two configuration utilities that you can use to configure your kernel. One utility, named config, is text based, and the other, named menuconfig, has a simple GUI (Graphical User Interface). The menuconfig utility is easier to use than config, so unless you have specific reasons use the menuconfig utility.
To use the menuconfig / config utility:
# make menuconfig
Or
# make config Once the configuration utility you choose is running, make sure that the following options are selected. Below shows the setting that must be enabled using the menuconfig and config utilities.
config: CONFIG_PCI
menuconfig: (Bus Options -> PCI Support)
config: SERIAL_8250
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> 8250/16550 and compatible serial support)
config: CONFIG_SERIAL_8250_EXTENDED
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> Extended 8250/16550 serial driver options)
config: CONFIG_SERIAL_8250_MANY_PORTS
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> Support more than 4 legacy serial ports)
config: CONFIG_SERIAL_8250_SHARE_IRQ
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> Support for sharing serial interrupts)
After all of the options have been checked and enabled, select exit. You will be prompted to save the new kernel configuration. Select yes. After you have finished configuring your kernel, issue the two following commands:
# make clean
# make bzImage
# make modules
# make modules_installBuilding/Installing the Kernel
NOTE: These instructions are for Red Hat standard installs. If you use a different distribution, or have set up your own system, these instructions will likely not help you. In that case please contact Connect Tech support at support@connecttech.com
Copy the kernel and system map to the boot partition:
The "make bzImage" step created the kernel in the subdirectory
/arch//boot. If you don't know what CPU type you're using, you can find the new kernel by:
- ls -l
Unknown macro: {Linux} /arch/*/boot/bzImage
The < cpu type > is the "*" part of the pathname of the newest kernel.
/arch//boot will be referenced by Unknown macro: {arch} .
- cp
/
Unknown macro: {arch}
/bzImage /boot/vmlinuz-bh
- cp
Unknown macro: {Linux}
/System.map /boot/System.map-bh
You may choose any postfix, -df is a handy one. The postfix merely distinguishes between the kernel you've just built and other kernels already installed. It has no other purpose.
Creating Nodes (Ports) For the Host Adapter
NOTE: Depending on your kernel distribution and configuration, nodes(ports) are often created automatically and you can skip this step. Check to see if they exist before proceeding.
Now that we have the new kernel in place capable of supporting the Blue Heat serial adapter we must create nodes, or ports, to allow the host adapter to communicate with other devices.
To begin, boot the new kernel. After the kernel has booted, open up the messages file using Vi, or your favorite text editor:
- vi
Unknown macro: {log_path} /messages
Where
is where the system logs are stored. Typically,
Unknown macro: {log_path} = /var/log but this may be different in some distributions/systems.
Go to the bottom of the file and search backwards for references to "ttySxx" where xx is a number. You should see ttyS0 and ttyS1 for the standard serial ports, as well as a ttySxx entrie for each installed Echo/Dflex port. In order to use the new ports, these ttySxx entries must exist in the /dev directory. If they do not exist (they aren't created automatically, but do persist after reboots) you must make them with the following command:
- mknod -m mode /dev/ttySxx c 4 yy
mode is the file mode (permissions) you wish the device to have. 600 is often good.
xx is the number associated with the device which you have seen in the messages file.
yy is just xx + 64
You may also wish to make the corresponding cuaxx devices, but they are being phased out:
- mknod -m
Unknown macro: {mode} /dev/cuaxx c 5 yy
xx and yy should match the xx and yy from the previous mknod command
Here is an example of what you would do to add the nodes to your /dev directory:
First I opened the Vi editor and search for ttyS*. The results of the search show me that I have ttyS00 and ttyS01 (the standard serial ports) entries, as well as four other entries: ttyS05, ttyS06, ttyS07 and ttyS08. These four entries correspond to the four new ports for my CTI host adapter. (Right now, we are assuming a four-port card. You may have fewer or more ports, depending on the type of card you have). I've written down the four entries on a sheet of paper, seeing how my memory is a little short. Now I would like to make the nodes. From the command line, I type in the four following entries:
- mknod -m 600 /dev/ttyS05 c 4 69
- mknod -m 600 /dev/ttyS06 c 4 70
- mknod -m 600 /dev/ttyS06 c 4 71
- mknod -m 600 /dev/ttyS07 c 4 72
and optionally execute:
- mknod -m 600 /dev/cua12 c 5 69
- mknod -m 600 /dev/cua13 c 5 70
- mknod -m 600 /dev/cua14 c 5 71
- mknod -m 600 /dev/cua15 c 5 72
With the nodes in place, this finishes off our installation
Multiport Support
NOTE: Multiport support is not necessary for your boards to operate properly. This may safely be skipped. It is only a performance tweak available for users with older systems. Newer PCs do not gain much performance from this tweak.
Check
/messages again. Each serial port will have a line; all the ports on each board will be listed in sequence. An eight port board might look like:
ttyS4 at port 0x300 (irq = 5) is a ST16654
ttyS5 at port 0x308 (irq = 5) is a ST16654
ttyS6 at port 0x310 (irq = 5) is a ST16654
ttyS7 at port 0x318 (irq = 5) is a ST16654
ttyS8 at port 0x320 (irq = 5) is a ST16654
ttyS9 at port 0x328 (irq = 5) is a ST16654
ttyS10 at port 0x330 (irq = 5) is a ST16654
ttyS11 at port 0x338 (irq = 5) is a ST16654
"port" in the above listing is really short for "port address". To avoid confusion, I will refer to the port address as the "address" instead.
Your board will have a table of the port addresses in the manual that came with it. You will need to look up the address that the board has been configured for; the line will also tell you what address the status port is at.
Unknown macro: {mask} is determined by the following table:
Number of ports
2 0x03 4 0x0f 8 0xffsetserial is used to inform the driver about the status port, in the following manner:
- setserial
Unknown macro: {port} set_multiport portX Unknown macro: {status port address} maskX Unknown macro: {mask} matchX 0x0
where
is any one port on a given board (using the first port is usually the best way),
Unknown macro: {status port address}
is the address of the status port as determined above,
Unknown macro: {mask}
is the appropriate mask value for the board from the table above, and X is a multiport setting number between 1 and 4.
The multiport setting number will usually be 1, but can be other values. There may be other multiport settings on the irq that your board is using, set by other boards in your system, including other Connect Tech boards.
- setserial
Unknown macro: {port} get_setserial
where
is a port on a board that you are going to use the status port on, will reveal if there are other multiport settings in effect already. If so, take care to choose X to be the lowest empty setting number.
This needs be done only once per board that you wish to have the status port used on.
Example:
You have two boards installed, an 8 port and a 2 port. The ports on each board are:
ttyS4 at port 0x300 (irq = 5) is a ST16654
.
.
ttyS11 at port 0x338 (irq = 5) is a ST16654
ttyS12 at port 0x200 (irq = 10) is a ST16654
ttyS13 at port 0x208 (irq = 10) is a ST16654
Check to see if any other multiport settings are already in use:
- setserial /dev/ttyS4 get_multiport
Multiport config for irq 5: Port Monitor = 0x0 Port1 = 0x1bf, mask=0xf, match=0xf Port2 = 0x0, mask=0x0, match=0x0 Port3 = 0x0, mask=0x0, match=0x0 Port4 = 0x0, mask=0x0, match=0x0One multiport setting is already in use by another board.
This works on a per irq basis, so each irq that is used by a board needs to be checked:
- setserial /dev/ttyS12 get_multiport
Multiport config for irq 10: Port Monitor = 0x0 Port1 = 0x0, mask=0x0, match=0x0 Port2 = 0x0, mask=0x0, match=0x0 Port3 = 0x0, mask=0x0, match=0x0 Port4 = 0x0, mask=0x0, match=0x0No multiport settings are in use.
The commands to enable use of the status port on each board would be:
- setserial /dev/ttyS4 set_multiport port2 0x340 mask2 0xff match2 0x00
- setserial /dev/ttyS12 set_multiport port1 0x240 mask1 0x03 match1 0x00
Check that the settings are in place:
- setserial /dev/ttyS4 get_multiport
Multiport config for irq 5: Port Monitor = 0x0 Port1 = 0x1bf, mask=0xf, match=0xf Port2 = 0x340, mask=0xff, match=0x0 Port3 = 0x0, mask=0x0, match=0x0 Port4 = 0x0, mask=0x0, match=0x0# setserial /dev/ttyS12 get_multiport
Multiport config for irq 10: Port Monitor = 0x0 Port1 = 0x240, mask=0x3, match=0x0 Port2 = 0x0, mask=0x0, match=0x0 Port3 = 0x0, mask=0x0, match=0x0 Port4 = 0x0, mask=0x0, match=0x0# man setserial
may be of help also.
RS-485 Line Modes Support
The utility set485 can be used to set the line mode interactively or from a startup script. Settings stick until changed or the system is rebooted.
The Linux header file ioctls.h now contains definitions for TIOCSER485GET and TIOCSER485SET. These ioctls can be used on Connect Tech 485 capable boards to set the line mode. The mode (passed as an integer) can be one of TIOCSER485FULLDUPLEX, TIOCSER485HALFDUPLEX or TIOCSER485SLAVEMULTIPLEX for full or half duplex or slave multidrop mode, respectively.
The Linux 2.6 standard serial driver does not have advanced RS485 mode support as of yet. If you require this functionality please contactsupport@connecttech.comfor the latest status of patches available.
More stream of consciousness ramblings:
OmniNotify v2.1 will not compile with the latest C++ offerings from GNU and Microsoft.
Why? Because support for the header <iostream.h> has been removed.
It is replaced by <iostream> (without the .h) and requires use of namespaces to access.
A patch to v2.1 that fixes this is attached
|